#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <vector>
using namespace std;
    void moveZeroes(vector<int>& nums) {
        int n = 0;
        int m = 0;
        while (n < nums.size())
        {
            if (nums[m] == 0)
            {
                nums.erase(nums.begin() + m);
                nums.push_back(0);
                n++;
                continue;
            }
            n++;
            m++;
        }
    }
int main()
{
    vector<int> a;
    a.push_back(0);
    a.push_back(1);
    a.push_back(0);
    a.push_back(3);
    a.push_back(12);
    moveZeroes(a);
    vector<int>::iterator it = a.begin();
    while (it != a.end())
    {
        cout << *it << " ";
        it++;
    }
}
